package com.centit.suixuan.puremvc.controller
{
	import com.centit.suixuan.puremvc.model.DataGridProxy;
	import com.centit.suixuan.puremvc.model.MenuProxy;
	import com.centit.suixuan.puremvc.model.UserProxy;
	import com.centit.suixuan.puremvc.view.DataGridMediator;
	import com.centit.suixuan.puremvc.view.MainMediator;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import spark.components.Group;

	public class DataGridCommand extends SimpleCommand implements ICommand
	{
		public function DataGridCommand()
		{
		}
		
		override public function execute(notification:INotification):void
		{
			
			var obj : Object = notification.getBody();
			var mainApplication : MainApplication = obj.mainApplication as MainApplication;
			var dataGridPanel : Group = obj.dataGridPanel as Group;

			if(!facade.hasProxy(DataGridProxy.NAME)) {
				facade.registerProxy(new DataGridProxy(DataGridProxy.NAME));
			}
			
			var dataGridMediator : DataGridMediator = new DataGridMediator(DataGridMediator.NAME, dataGridPanel);
			
			facade.registerMediator(dataGridMediator);

			
			
			dataGridMediator.init();
		}
		
		
	}
}